package com.games.game.service;

import com.games.game.bean.Game;
import com.games.game.mapper.GamesMapper;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class Game_ServiceImp implements Game_Service {
    private GamesMapper gamesMapper;

    public Game_ServiceImp() {
        gamesMapper = new GamesMapper();
    }

    public List<Game> get_all_games() {
        return gamesMapper.get_all();
    }

    public Game get_cer_games(String name) {
        return gamesMapper.get_cer(name);
    }

    public List<Game> get_cer_num_games(int num) {
        return gamesMapper.get_cer_num_games(num);
    }

    public List<Game> get_cer_type_games(String type) {
        return gamesMapper.get_cer_type_games(type);
    }

    public void purchase(String name) {
        gamesMapper.purchase(name);
    }

    public void refund(String name) {
        gamesMapper.refund(name);
    }
}
